export const state = () => ({
    currentRegister: 0,//开户组件的当前状态
    currentRecharge: 0,//充值组件的当前状态
  });
  
  //控制当前的组件状态
  export const getters = {
    currentRegister(state) {
      return state.currentRegister;
    },
    currentRecharge(state) {
      return state.currentRecharge;
    }
  };
  
  export const mutations = {
    incrementCurrentRegister(state) {
      state.currentRegister++;
      if(state.currentRegister > 4) {
        state.currentRegister = 0;
      }
    },
    decrementCurrentRegister(state) {
      state.currentRegister--;
      if(state.currentRegister < 0) {
        state.currentRegister = 0;
      }
    },
    incrementCurrentRecharge(state) {
      state.currentRecharge++;
      if(state.currentRecharge > 2) {
        state.currentRecharge = 0;
      }
    },
    decrementCurrentRecharge(state) {
      state.currentRecharge--;
      if(state.currentRecharge < 0) {
        state.currentRecharge = 0;
      }
    }
  };
  